package com.yx.doodleview.bean;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by yx on 2017/8/21.
 */

public class ColorBean implements Parcelable {
    private int color;
    private String text;
    private int strkenWidth;
    private boolean isCheck=false;

    public boolean isCheck() {
        return isCheck;
    }

    public void setCheck(boolean check) {
        isCheck = check;
    }

    public int getStrkenWidth() {
        return strkenWidth;
    }

    public void setStrkenWidth(int strkenWidth) {
        this.strkenWidth = strkenWidth;
    }

    public int getColor() {
        return color;
    }

    public void setColor(int color) {
        this.color = color;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public ColorBean() {
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.color);
        dest.writeString(this.text);
        dest.writeInt(this.strkenWidth);
        dest.writeByte(this.isCheck ? (byte) 1 : (byte) 0);
    }

    protected ColorBean(Parcel in) {
        this.color = in.readInt();
        this.text = in.readString();
        this.strkenWidth = in.readInt();
        this.isCheck = in.readByte() != 0;
    }

    public static final Creator<ColorBean> CREATOR = new Creator<ColorBean>() {
        @Override
        public ColorBean createFromParcel(Parcel source) {
            return new ColorBean(source);
        }

        @Override
        public ColorBean[] newArray(int size) {
            return new ColorBean[size];
        }
    };
}
